<div class='right-cont wrap-fuser' ng-controller='FUserList'>
    <div class='title'>会员列表({{count}})<i class='fa fa-spin fa-spinner' ng-if='loading'></i></div>
    <div class='content'>
        <div class='box-ops clearfix'>
            <div class='box-breadcrumb'>
                <div class='breadcrumb'>
                    <li class='link' ng-repeat='p in breadcrumb' ng-click='child_users(p.father_id, p.nickname)'>
                        {{p.nickname}}
                    </li>
                </div>
            </div>
            <div class='box-search-key-date'>
                <div class='input-group input-group-date'>
                    <input type='text' class='form-control input-date' placeholder='起始时间'
                        ng-model='dateS'>
                    <span class='input-group-addon'>至</span>
                    <input type='text' class='form-control input-date' placeholder='结束时间'
                        ng-model='dateE'>
                </div>
                <input type='text' class='form-control input-keyword' placeholder='ID|昵称|角色|手机号'
                    ng-model='keyword'>
                <button class='btn btn-primary' ng-click='load_list(1)'>搜索</button>
                <button class='btn btn-success' ng-click='out_excel()'>导出</button>
            </div>
        </div>
        <div class='box-list' style='overflow-x:scroll; min-width: 1000px;'>
            <table class='table table-list' style='min-width: 1600px;'>
                <tr>
                    <td>用户ID <span class='fa fa-sort'></span></td>
                    <td>微信昵称<span class='fa fa-sort'></span></td>
                    <td>注册手机号<span class='fa fa-sort'></span></td>
                    <td>真实姓名<span class='fa fa-sort'></span></td>
                    <td class='sort' ng-click='change_sort("role_id")'>
                        角色类型<span class='fa fa-sort' data-sort='role_id'></span>
                    </td>
                    <!-- <td>手机号<span class='fa fa-sort'></span></td> -->
                    <td>幼儿数量<span class='fa fa-sort'></span></td>
                    <td class='sort' ng-click='change_sort("score")'>
                        积分<span class='fa fa-sort' data-sort='score'></span>
                    </td>
                    <td class='sort' ng-click='change_sort("amount")'>
                        累计金额<span class='fa fa-sort' data-sort='amount'></span>
                    </td>
                    <td class='sort' ng-click='change_sort("wallet")'>
                        钱包余额<span class='fa fa-sort' data-sort='wallet'></span>
                    </td>
                    <td class='sort' ng-click='change_sort("vip_level")'>
                        VIP等级<span class='fa fa-sort' data-sort='vip_level'></span>
                    </td>
                    <td class='sort' ng-click='change_sort("develop_count")'>
                        下线人数<span class='fa fa-sort' data-sort='develop_count'></span>
                    </td>
                    <td>关注时间<span class='fa fa-sort'></span></td>
                    <td>操作<span class='fa fa-sort'></span></td>
                </tr>
                <tr ng-repeat='user in users.list'>
                    <td>{{user.id || '未知'}}</td>
                    <td>{{user.nickname || '未知'}}</td>
                    <td>{{user.username || '未知'}}</td>
                    <td>{{user.truename || '未知'}}</td>
                    <td>{{user.role_text || '未知'}}</td>
                   <!--  <td>{{user.mobile || '未知'}}</td> -->
                    <td>{{user.school_students || 0}}</td>
                    <td>{{user.score || '未知'}}</td>
                    <td>{{user.amount || '未知'}}</td>
                    <td>{{user.wallet || '未知'}}</td>
                    <td>{{user.vip_level || '未知'}}</td>
                    <td>{{user.child_count || 0}}</td>
                    <td>{{user.subscribe_date || '未知'}}</td>
                    <td>
                        <button class='btn btn-primary btn-xs btn-w-xs' ng-click='detail(user.id)'>详情</button>
                        <button class='btn btn-success btn-xs btn-w-xs' ng-click='child_users(user.id, user.nickname)'>下级</button>
                        <button class='btn btn-warning btn-xs btn-w-xs' ng-click='edit(user.id)'>编辑</button>
                        <button class='btn btn-warning btn-xs btn-w-xs' ng-click='get_vip_info(user)'>VIP</button>
                    </td>
                </tr>
            </table>
            <div class='box-page' ng-bind-html='pageHtml'></div>
        </div>
    </div>
    
    <!--用户详情模态窗-->
    <div class='modal fade user-detail'>
        <div class='modal-dialog modal-lg'>
            <div class='modal-content'> 
                <div class='modal-header'>
                    用户详情信息
                    <a class='close' data-dismiss='modal'>&times;</a>
                </div>
                <div class='modal-body'>
                    <table class='table-info'>
                        <tr>
                            <td>微信昵称:</td>
                            <td>{{user.userInfo.nickname || '未知'}}</td>
                            <td>真实姓名:</td>
                            <td>{{user.userInfo.truename || '未知'}}</td>
                            <td>QQ号:</td>
                            <td>{{user.userInfo.qq || '未知'}}</td>
                        </tr>
                        <tr>
                            <td>用户名:</td>
                            <td>{{user.userInfo.username || '未知'}}</td>
                            <td>手机号:</td>
                            <td colspan='3'>{{user.userInfo.mobile || '未知'}}</td>
                        </tr>
                        <tr>
                            <td>VIP等级:</td>
                            <td>{{user.userInfo.vip_level || '未知'}}</td>
                            <td>VIP到期时间:</td>
                            <td colspan='3'>{{user.userInfo.vip_enddate || '未知'}}</td>
                        </tr>
                        <tr>
                            <td>所在国家:</td>
                            <td>{{user.userInfo.country || '未知'}}</td>
                            <td>所在省份:</td>
                            <td>{{user.userInfo.province || '未知'}}</td>
                            <td>所在城市:</td>
                            <td>{{user.userInfo.city || '未知'}}</td>
                        </tr>
                        <tr>
                            <td>幸福合伙人:</td>
                            <td>{{user.relaInfo.dean_id.nickname || '无'}}</td>
                            <td>幸福教练:</td>
                            <td>{{user.relaInfo.expand_id.nickname || '无'}}</td>
                            <td>推广大使:</td>
                            <td>{{user.relaInfo.teacher_id.nickname || '无'}}</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--用户信息编辑模态窗-->
    <div class='modal fade user-edit'>
        <div class='modal-dialog'>
            <div class='modal-content' align='center'>
                <div class='modal-header'>
                    用户信息更改
                    <a class='close' data-dismiss='modal'>&times;</a>
                </div>
                <div class='modal-body'>
                    <table class='table-form'>
                        <tr>
                            <td class='td-label'>用户角色:</td>
                            <td>
                                <select class='form-control' ng-model='user.user_info.role_id'>
                                    <option value='101'>健康合伙人</option>
                                    <option value='102'>健康教练A</option>
                                    <option value='103'>健康教练B</option>
                                    <option value='104'>健康教练C</option>
                                    <option value='105'>健康推广大使</option>
                                    <option value='106'>健康家长</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>上级ID:</td>
                            <td>
                                <input type='number' class='form-control' ng-model='user.rela_info.father_id'>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>手机号码:</td>
                            <td><input type='text' class='form-control' ng-model='user.user_info.mobile'></td>
                        </tr>
                        <tr>
                            <td class='td-label'>真实姓名:</td>
                            <td><input type='text' class='form-control' ng-model='user.user_info.truename'></td>
                        </tr>
                        <tr>
                            <td class='td-label'>院所姓名:</td>
                            <td><input type='text' class='form-control' ng-model='user.user_info.child_school'></td>
                        </tr>
                        <tr>
                            <td class='td-label'>班级名称:</td>
                            <td><input type='text' class='form-control' ng-model='user.user_info.child_course_name'></td>
                        </tr>
                    </table>
                </div>
                <div class='modal-footer'>
                    <button class='btn btn-primary btn-sm btn-w-sm' ng-click='save()'>确认</button>
                    <button class='btn btn-default btn-sm btn-w-sm' data-dismiss='modal'>取消</button>
                </div>
            </div>
        </div>
    </div>
    <!--VIP信息更改模态窗 -->
    <div class='modal fade user-vip'>
        <div class='modal-dialog'>
            <div class='modal-content' align='center'>
                <div class='modal-header'>
                    VIP信息更改
                    <a class='close' data-dismiss='modal'>&times;</a>
                </div>
                <div class='modal-body'>
                    <table class='table-form'>
                        <tr>
                            <td class='td-label'>用户名称:</td>
                            <td>
                                {{nUser.truename || nUser.nickname}}
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>VIP级别:</td>
                            <td>
                                <select ng-model='nUser.vip_level' class='form-control'>
                                    <option value='0'>非VIP</option>
                                    <option value='1'>等级1</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>到期时间:</td>
                            <td><input type='text' class='form-control input-date' ng-model='nUser.vip_enddate'></td>
                        </tr>
                    </table>
                </div>
                <div class='modal-footer'>
                    <button class='btn btn-primary btn-sm btn-w-sm' ng-click='update_vip_info()'>确认</button>
                    <button class='btn btn-default btn-sm btn-w-sm' data-dismiss='modal'>取消</button>
                </div>
            </div>
        </div>
    </div>

</div>